package com.eve.DAObjects;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.eve.crp.Client;

public class ClientRowMapper implements RowMapper<Client> {

	@Override
	public Client mapRow(ResultSet rs, int rowNum) throws SQLException {
		Client client = new Client();
		client.setBirthdate(rs.getDate("Birthday"));
		client.setCity(rs.getInt("City"));
		client.setCreatedDate(rs.getDate("EnteredDate"));
		client.setDisabled(rs.getBoolean("Disabled"));
		client.setFirstname(rs.getString("FirstName"));
		client.setLastname(rs.getString("LastName"));
		client.setNeedCategory(rs.getInt("NeedID"));
		client.setNeedDate(rs.getDate("NeedDate"));
		client.setNeedDescription(rs.getString("NeedDescription"));
		client.setNumOfChildren(rs.getInt("NumOfChildren"));
		client.setStreet(rs.getString("Street"));
		client.setVeteran(rs.getBoolean("Veteran"));
		client.setZip(rs.getInt("Zip"));
		return client;
	}
	
}
